<!DOCTYPE html>
<title>Tests cancelling a requestAnimationFrame callback</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<script>
  async_test(t => {
    let callbackFired = false;
    let id = window.requestAnimationFrame(function() {
      callbackFired = true;
    });
    window.cancelAnimationFrame(id);
    window.requestAnimationFrame(function() {
      t.step(function() {
        assert_false(callbackFired, "Callback should not fire.");
      });
      t.done();
    });
  }, "Test cancelling a rAF callback");
</script>
